package com.zone.domain.acticity.service.quota;

import com.zone.domain.acticity.model.valobj.ActivitySkuStockSubTaskVO;
import com.zone.domain.acticity.repository.IActivityRepository;
import com.zone.domain.acticity.service.IActivitySkuStock;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author: zongzi
 * @description: TODO
 * @date: 2025/2/15
 */
@Slf4j
@Service
public class ActivitySkuStockImpl implements IActivitySkuStock {
    @Autowired
    private IActivityRepository activityRepository;

    @Override
    public boolean descActivitySkuStock(Long sku) {
        return activityRepository.descActivitySkuStock(sku);
    }

    @Override
    public void offerActivitySkuStockSubTask(ActivitySkuStockSubTaskVO subTaskVO) {
        activityRepository.offerActivitySkuStockSubTask(subTaskVO);
    }

    @Override
    public ActivitySkuStockSubTaskVO pollAwardStockSubTask() {
        return activityRepository.pollAwardStockSubTask();
    }

    @Override
    public void decrActivitySkuCountSurplus(Long sku) {
        activityRepository.decrActivitySkuCountSurplus(sku);
    }

    @Override
    public void clearZeroActivitySkuCount(Long sku) {
        activityRepository.clearZeroActivitySkuCount(sku);
    }
}
